namespace TradeFlow.Server.Models;

/// <summary>
/// 商品信息
/// </summary>
[SugarTable(nameof(JxGoods), "商品信息")]
public class JxGoods : EntityBase
{
    /// <summary>
    /// 商品编码
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "商品编码")]
    public string Code { get; set; }

    /// <summary>
    /// 商品名称
    /// </summary>
    [Required, MaxLength(200)]
    [SugarColumn(ColumnDescription = "商品名称")]
    public string Name { get; set; }

    /// <summary>
    /// 商品类别
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "商品类别")]
    public string Category { get; set; }

    /// <summary>
    /// 规格型号
    /// </summary>
    [MaxLength(500)]
    [SugarColumn(ColumnDescription = "规格型号", IsNullable = true)]
    public string Model { get; set; }

    /// <summary>
    /// 产地
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "产地", IsNullable = true)]
    public string Producer { get; set; }

    /// <summary>
    /// 计量单位
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "计量单位")]
    public string Unit { get; set; }

    /// <summary>
    /// 采购单价
    /// </summary>
    [SugarColumn(ColumnDescription = "采购单价", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? BuyPrice { get; set; }

    /// <summary>
    /// 销售单价
    /// </summary>
    [SugarColumn(ColumnDescription = "销售单价", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? SalePrice { get; set; }

    /// <summary>
    /// 安全库存
    /// </summary>
    [SugarColumn(ColumnDescription = "安全库存", IsNullable = true)]
    public int? SafeQty { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Note { get; set; }

    /// <summary>
    /// 附件
    /// </summary>
    [MaxLength(500)]
    [SugarColumn(ColumnDescription = "附件", IsNullable = true)]
    public string Files { get; set; }
}